package com.joysuch.wwyt.bp.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * @author: JamesZY
 * @date: 2021/9/7
 * @description:
 */

//@SQLDelete(sql = "update wwyt_api_token set DELETE_FLAG = '1' where id= ?")
//@SQLDeleteAll(sql = "update wwyt_api_token set DELETE_FLAG = '1' where id= ?")
//@Where(clause = "DELETE_FLAG = '0'")
@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Table(name = "wwyt_api_token")
@Data
@Entity
public class ApiToken implements Serializable {
    //    @Id
//    @GeneratedValue(strategy = IDENTITY)
    private Long id;

    private String appId;

    private String secret;

    private Long tenentId;

    private String orgCode;

    private Integer expiredTime;

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "APPID", length = 30)
    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    @Column(name = "SECRET", length = 64)
    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return tenentId;
    }

    public void setTenentId(Long tenentId) {
        this.tenentId = tenentId;
    }

    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    @Column(name = "EXPIRED_TIME")
    public Integer getExpiredTime() {
        return expiredTime;
    }

    public void setExpiredTime(Integer expiredTime) {
        this.expiredTime = expiredTime;
    }

}



















